<?php

namespace App\Http\Controllers\Api;

use App\Model\Category;
use App\Model\Page;
use App\Services\PageService;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Input;


class CategoryController extends Controller
{
    public function listTags()
    {
        $tags  = Category::where('type',Category::TYPE_TAG)->inRandomOrder()->get();
        //跨域调用标识
        $callback = Input::get('callback');
        return self::apiSucc($tags,$callback);
    }

    public function listCates()
    {
        $cates  = Category::where('type',Category::TYPE_CATE)->inRandomOrder()->get();
        //跨域调用标识
        $callback = Input::get('callback');
        return self::apiSucc($cates,$callback);
    }
}
